<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
       
    </style>
</head>
<body>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
    </ul>
    <img src="img/1.png" alt="">
    <script src="jquery/jquery-3.6.0.js"></script>
    <script>
        var arr = ["img/1.png","img/2.png","img/3.png"]
        $("li").click(function(){
            var i = $(this).index();
            console.log(i)
            $("img").attr("src",arr[i]);
        })
    </script>
</body>
</html>